#include "common.h"
VOID MMServer()
{
 // Print("the size of the process %#0CX\n",sizeof(PROCESS));
  SIGNAL  signal;
  MESSAGE message;
   while(1)
   {
    if(ReceiveMessage(&message)!=ARTIST_ERROR_OK)continue;
     switch(message.type)
     {
       case MMSERVER_WHOIAM:
       {
          Print("MMServer begin...\n");
          break;
       }
       case MMSERVER_PAGEDISTRIBUTION:
       {
         signal.returnvalue=(U4B)MMPageDistribute((PMMPARAMETER)(message.value0));
         signal.dt=message.sourcepid;
		 signal.signal=MMSERVER_PAGEDISTRIBUTION;
		 NotifyWaited(&signal);
         break;
       }
       case MMSERVER_PAGERESTORATION:
       {
         signal.returnvalue=(U4B)MMPageRestore((PMMPARAMETER)(message.value0));
         signal.dt=message.sourcepid;
		 signal.signal=MMSERVER_PAGERESTORATION;
		 NotifyWaited(&signal);
         break;
       }
       case MMSERVER_LOCKPAGE:
	   {
	   	 signal.returnvalue=(U4B)MMLockPage((PMMPARAMETER)(message.value0));
         signal.dt=message.sourcepid;
		 signal.signal=MMSERVER_LOCKPAGE;
		 NotifyWaited(&signal);
	   	 break;
	   }
	   case MMSERVER_UNLOCKPAGE:
	   {
	   	 signal.returnvalue=(U4B)MMUnlockPage((PMMPARAMETER)(message.value0));
         signal.dt=message.sourcepid;
		 signal.signal=MMSERVER_LOCKPAGE;
		 NotifyWaited(&signal);
	   	  break;
	   }
	   case MMSERVER_SWAPPAGE:
	   {
	   	   break;
	   }
     }
   }
}

